xen/arm: Correctly report the memory region in the dummy NUMA helpers
authorJulien Grall <julien.grall@arm.com>
Fri, 29 Sep 2017 20:16:47 +0000 (13:16 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 29 Sep 2017 20:23:11 +0000 (13:23 -0700)
commit5414ba7f5e1ffc88ed2758b1e1b14bbfd3536a61
tree50853cc04cd2b335561e0ad4891074a91ed6cb2e
parentec6d9023e1f54cdccbf2e4c63cf947f1be2b1e8e
xen/arm: Correctly report the memory region in the dummy NUMA helpers

NUMA is currently not supported on Arm. Because common code is
NUMA-aware, dummy helpers are instead provided to expose a single node.

Those helpers are for instance used to know the region to scrub.

However the memory region is not reported correctly. Indeed, the
frametable may not be at the beginning of the memory and there might be
multiple memory banks. This will lead to not scrub some part of the
memory.

The memory information can be found using:
    * first_valid_mfn as the start of the memory
    * max_page - first_valid_mfn as the spanned pages

Note that first_valid_mfn is now been exported. The prototype has been
added in asm-arm/numa.h and not in a common header because I would
expect the variable to become static once NUMA is fully supported on
Arm.

This is XSA-245.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reported-and-Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/page_alloc.c
xen/include/asm-arm/numa.h